//
//  NYWeiGuoCell.swift
//  SheYangBigData
//
//  Created by 宋海胜 on 2020/12/30.
//  Copyright © 2020 叁拾叁. All rights reserved.
//

import UIKit

class NYWeiGuoCell: SYBaseCell {

    let contentLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0xFFA800)
        v.font = 13.autoFontSize()
        v.text = "您发布的内容未通过审核"
        return v
    }()
    
    let timeLb: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x333333)
        v.font = 10.autoFontSize()
        
        return v
    }()
    
    let jinggao: UIImageView = {
        let v: UIImageView = UIImageView()
        v.layer.cornerRadius = 9.0.autoWidth()
        v.image = UIImage(named: "tanhao")
        return v
    }()
    
    let tuPian: UIImageView = {
        let v: UIImageView = UIImageView()
        v.layer.cornerRadius = 3.0.autoWidth()
        v.clipsToBounds = true
        return v
    }()
    
    let arrow: UIImageView = {
        let v: UIImageView = UIImageView()
        v.image = UIImage(named: "arrow")
        return v
    }()

    public func configureView(_ model: PYDianzanListModel) {
        if let d = model.updateDate {
            timeLb.text =  d
             
        } else if let d = model.createDate {
            timeLb.text =  d
        }
        tuPian.kf.setImage(with: (model.imgUrl ?? "").sy_imageURL())
    }
    
    override func initViews() {
        
        addSubview(jinggao)
        addSubview(contentLb)
        addSubview(timeLb)
        addSubview(tuPian)
        addSubview(lineView)
        addSubview(arrow)
        jinggao.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(27.5.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(15.0))
            make.width.equalTo(18.0.autoWidth())
            make.height.equalTo(18.0.autoWidth())
        }
        contentLb.snp.makeConstraints { (make) in
            make.top.equalTo(jinggao.snp.top).offset(autoWidth(1.5))
            make.left.equalTo(jinggao.snp.right).offset(autoWidth(10.0))
            make.width.equalTo(200.0.autoWidth())
            make.height.equalTo(13.0.autoWidth())
        }
        timeLb.snp.makeConstraints { (make) in
            make.top.equalTo(contentLb.snp.bottom).offset(autoWidth(23.5))
            make.height.equalTo(10.0.autoWidth())
            make.left.equalTo(contentLb.snp.left)
            make.width.equalTo(200.0.autoWidth())
            make.bottom.equalToSuperview().offset(autoWidth(-30.0))
        }
        tuPian.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(20.0.autoWidth())
            make.right.equalToSuperview().offset(autoWidth(-35.0))
            make.width.equalTo(71.0.autoWidth())
            make.height.equalTo(71.0.autoWidth())
        }
        lineView.snp.makeConstraints { (make) in
            make.bottom.equalToSuperview()
            make.left.equalToSuperview().offset(autoWidth(15.0))
            make.right.equalToSuperview().offset(autoWidth(-15.0))
            make.height.equalTo(0.5.autoWidth())
        }
        arrow.snp.makeConstraints { (make) in
            make.centerY.equalToSuperview()
            make.right.equalToSuperview().offset(autoWidth(-15.0))
            make.height.equalTo(12.5.autoWidth())
            make.width.equalTo(7.5.autoWidth())
        }
    }
}

